package pictonary;

import Beans.Usuario;
import Daos.DaoBase;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author angel
 */
public class Server {

    public static void main(String[] args) {
        Usuario u = new Usuario();
    }



    public boolean recibeUsuarios(Usuario u, int i){
        try {
            DaoBase db = new DaoBase();
            boolean conectar = db.conectar();
            boolean validar = db.validar(u);
            boolean retorno;
            if(conectar){
                if(validar){
                    switch (i){
                        case 1:
                            retorno = true;
                            break;
                        case 2:
                            retorno = false;
                            break;
                    }
                }else{
                    switch(i){
                        case 1:
                            retorno = false;
                            break;
                        case 2:
                            retorno = true;
                            break;
                    }
                }
            }
        } catch (SQLException ex) {
            System.out.println(ex.getMessage());
        } return false;
    }

}

